﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using zhangmenren.IService;
using zhangmenren.Models;
using zhangmenren.Repository;
using zhangmenren.ViewModel;

namespace zhangmenren.Service
{
	public class ApplyService : IApplyService
	{
		private ApplyRepository applyRepository = new ApplyRepository();
		public Task<int> Add(ApplyEntity entity)
		{



			return Task.FromResult(applyRepository.Add(entity));
		}

        public Task<int> Del(int id)
        {
            return Task.FromResult(applyRepository.Del(id));
        }

        public Task<IEnumerable<ApplyEntity>> FindByUserId(int userId)
		{
			return Task.FromResult(applyRepository.FindByUserId(userId));
		}

		public Task<IEnumerable<ApplyModel>> Select()
		{
            return Task.FromResult(applyRepository.Select());
        }

		public Task<int> UpState(int id, int state)
		{
            return Task.FromResult(applyRepository.UpState(id,state));
        }
    }
}
